/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prueba.view.html.body.tree;

import prueba.view.html.Body;
import prueba.view.html.ElementSupport;
import prueba.view.html.ElementSupportTree;

/**
 *
 * @author HP_Propietario
 */
public class Div extends ElementSupportTree implements Body {

    private StringBuffer stringBuffer;
    private String contenido;
    private Body body;
    public Div() {
    }

    /***
     *
     *
     *
     *
     *
     *
     */
    public Div(String contenido) {
        this.contenido = contenido;
        stringBuffer = new StringBuffer();
    }

    /***
     *
     *
     *
     *
     *
     *
     */
    public StringBuffer print() {

        stringBuffer.append("<div" + super.printAttributes().toString() + ">");
        if (getContent() == null) {
            //no hacemos nada!
        } else {
            stringBuffer.append(getContent());
        }
        if(body!=null){
            stringBuffer.append(body.print().toString());
        }
        stringBuffer.append("</div>");
        return stringBuffer;
    }

    /***
     *
     *
     *
     *
     *
     *
     */
    public void setContent(String contenido) {
        this.contenido = contenido;
    }

    /***
     *
     *
     *
     *
     *
     *
     */
    protected String getContent() {
        return this.contenido;
    }
}
